from rest_framework import serializers

from api.models import WavFiles, Histories


class WavFilesSerializer(serializers.ModelSerializer):
    # 为分组提供数据
    class Meta:
        model = WavFiles
        fields = "__all__"
        read_only_fields = ['id']


class HistoriesSerializer(serializers.ModelSerializer):
    wav = WavFilesSerializer()

    # 为分组提供数据
    class Meta:
        model = Histories
        fields = "__all__"
        read_only_fields = ['id']
